package entity

import "time"

// Pipeline 结构体对应数据库表 `pipelines`
type Pipeline struct {
	ID              int        `gorm:"primaryKey;autoIncrement" json:"id"`
	JobName         string     `gorm:"size:100;not null;unique" json:"job_name"`
	DescriptionCN   string     `gorm:"size:255;not null" json:"description_cn"`
	CodePackageType string     `gorm:"size:100;not null;unique" json:"code_package_type"`
	URL             string     `gorm:"size:255;not null" json:"url"`
	CreatedAt       time.Time  `gorm:"type:timestamp;not null;default:CURRENT_TIMESTAMP" json:"created_at"`
	UpdatedAt       time.Time  `gorm:"type:timestamp;not null;default:CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP" json:"updated_at"`
	DeletedAt       *time.Time `gorm:"type:timestamp;default:null" json:"deleted_at"`
}

// TableName 指定数据库表名（可选）
func (Pipeline) TableName() string {
	return "pipelines"
}
